package oj.util.sUtil;

import java.io.InputStream;
import java.util.Properties;

public class CargarPropiedades {

	private String IP;
	private String PROTOCOL;
	private String PORT;;

	public CargarPropiedades() {
		try {

			// obtengo el Path del .jar
			InputStream input = ClassLoader
					.getSystemResourceAsStream("SERVER.PROPERTIES");
			Properties prop = new Properties();
			prop.load(input);

			// obtento los datos de configuracion del JBoss
			setIP(prop.getProperty("JBOSS_IP"));
			setPORT(prop.getProperty("JBOSS_PORT"));
			setPROTOCOL(prop.getProperty("JBOSS_PROTOCOL"));

		} catch (Exception e) {
			e.printStackTrace();
		}

	}

	public String getIP() {
		return IP;
	}

	public void setIP(String ip) {
		IP = ip;
	}

	public String getPROTOCOL() {
		return PROTOCOL;
	}

	public void setPROTOCOL(String protocol) {
		PROTOCOL = protocol;
	}

	public String getPORT() {
		return PORT;
	}

	public void setPORT(String port) {
		PORT = port;
	}
}
